# $Id: PKGBUILD 82162 2013-01-09 22:03:54Z svenstaro $
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor: TDY <tdy@gmx.com>
# Contributor: Nelson Menon <nelsonmenon@gmail.com insanatorium.wordpress.com>

pkgname=freecol
pkgver=0.10.7
pkgrel=1
pkgdesc="A turn-based strategy game based on Colonization"
arch=('any')
url="http://www.freecol.org/"
license=('GPL')
depends=('java-runtime')
source=(http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.zip
        fc.desktop
        fc.sh)
md5sums=('554c2c8acd63cbd0c258e367305a4cb7'
         '55594d770904af3e3e3852d375085357'
         'cb99e1a277dbc6ad6d2754f4322b869a')

build() {
  cd "$srcdir/$pkgname"
}

package() {
  cd "$srcdir/$pkgname"

  install -Dm644 FreeCol.jar "$pkgdir/usr/share/java/$pkgname/FreeCol.jar"
  install -Dm644 FreeCol.pdf "$pkgdir/usr/share/doc/$pkgname/FreeCol.pdf"
  install -Dm644 $pkgname.xpm "$pkgdir/usr/share/pixmaps/$pkgname.xpm"
  install -Dm644 ../fc.desktop "$pkgdir/usr/share/applications/$pkgname.desktop"
  install -Dm755 ../fc.sh "$pkgdir/usr/bin/$pkgname"

  cp -r data jars "$pkgdir/usr/share/java/$pkgname/"
  find "$pkgdir/usr/share/java/$pkgname" -type d -exec chmod 755 '{}' \;
  find "$pkgdir/usr/share/java/$pkgname" -type f -exec chmod 644 '{}' \;
}
